# Filters added to this controller apply to all controllers in the application.
# Likewise, all the methods added will be available for all controllers.

class ApplicationController < ActionController::Base
  helper :all # include all helpers, all the time

  # See ActionController::RequestForgeryProtection for details
  # Uncomment the :secret if you're not using the cookie session store
  protect_from_forgery # :secret => '1999163de5feb5044980b6ce3fe73d1d'
  
  # Filters added to this controller will be run for all controllers in the
  # application.
  # Likewise, all the methods added will be available for all controllers.

    def authenticate
      if session['user'].nil?
        session['initial_uri'] = request.request_uri
        redirect_to :controller => "users", :action => "login" 
      end
    end
  
end
